<?php
	session_start();
	
	if (isset($_SESSION['username'])){$login = true;}
	else{$login = false;}
	$loguname = $_SESSION['username'];
	$username = $_GET['un'];
	
	if (!$login&&$username==NULL){
    	require_once('../configu.php');
		header("Location: ".$CFG->url."home.php");
	}
	else {
		if ($username==NULL) $username=$loguname;
		$path = 'users/'.$username.'/';
?>
    <div id="photolist">	
        <div class="box">List Photo</div>
        <div class="bottomcontrol">
            <?php if($loguname==$username){ ?>
                <div class="button180" style="float:left"  onclick="divUpload();">Upload Foto</div>
            <?php } ?>
        </div>
        <div id="photoarea">
<?php	require 'photo_listn.php'; ?>
        </div>
<?php	
		if (file_exists('photo.php')) require_once 'photo.php';
		else if (file_exists('php/photo.php')) require_once 'php/photo.php';
		else require_once '../photo.php';				
		$nfoto = mysql_num_rows(photo::getPhotoes($username));
		if ($nfoto>5){
?>
        <div class="bottomcontrol">
            <a id="morePhoto" href="javascript:void()" onClick="morePhoto('<?php echo $username; ?>', 5)" style="color:#FFF">See More Photo</a>
        </div>
<?php	}				?>
    </div>
<?php	
	}
?>